package com.dongdongshop.serviceImpl;

import com.dongdongshop.mapper.TbContentCategoryMapper;
import com.dongdongshop.mapper.TbContentMapper;
import com.dongdongshop.pojo.TbBrand;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.pojo.TbContentCategory;
import com.dongdongshop.service.TbContentCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbContentCategoryServiceImpl implements TbContentCategoryService {
    @Autowired
    private TbContentCategoryMapper tbContentCategoryMapper;
    @Override
    public List<TbContentCategory> selectAll() {
        List<TbContentCategory> categories = tbContentCategoryMapper.selectByExample(null);
        return categories;
    }

    @Override
    public void addAll(TbContentCategory tbContentCategory) {
        tbContentCategoryMapper.insertSelective(tbContentCategory);
    }
    //回显
    @Override
    public TbContentCategory selectById(Long id) {
        TbContentCategory tbContentCategory = tbContentCategoryMapper.selectByPrimaryKey(id);
        return tbContentCategory;
    }
    //修改
    @Override
    public void updateAll(TbContentCategory tbContentCategory) {
        tbContentCategoryMapper.updateByPrimaryKeySelective(tbContentCategory);
    }

    @Override
    public void deleteBatch(Long[] ids) {
        tbContentCategoryMapper.deleteBatch(ids);
    }
}
